<?php 
	include ('lib/twitese.php');
	$title = "随便看看";
	include ('inc/header.php');
	
	if (!isLogin()) header('location: login.php');
?>

<script type="text/javascript" src="js/browse.js"></script>

<div id="statuses">
	<div class="weibo_ptWrapPdd">
		<h2 id="browse_title">随便看看其他人在做什么...</h2>
		<div class="clear"></div>
	</div>
	<div class="weibo_postList">
		<?php 
			$t = getTwitter();
			$p = 1;
			if (isset($_GET['p'])) {
				$p = (int) $_GET['p'];
				if ($p <= 0) $p = 1;
			}
		
			$statuses = $t->publicTimeline($p);
			if ($statuses === false) {
				header('location: error.php');
			} 
			$empty = count($statuses) == 0? true: false;
			if ($empty) {
				echo "<div id=\"empty\">此页无内容</div>";
			} else {
			
				tpTimeline($statuses);
				
			}
			
			
			
		?>
	</div>
</div>

<?php 
	include ('inc/sidebar.php');
?>

<?php 
	include ('inc/footer.php');
?>
